<template>
  <a-form-model-item :label="label" :prop="prop" :labelCol="labelCol" :wrapperCol="wrapperCol">
    <a-textarea
      v-if="readonly"
      v-model="form[prop]"
      :placeholder="placeholder"
      disabled
      style="background-color:#fff;color: rgba(0, 0, 0, 0.65);cursor: auto;"
      :prefix="prefix"
      :suffix="suffix"
      :autoSize="{ minRows: rows, maxRows: rows }"
    >
    </a-textarea>
    <a-textarea
      v-else
      v-model="form[prop]"
      :placeholder="placeholder"
      :disabled="disabled"
      :prefix="prefix"
      :suffix="suffix"
      :autoSize="{ minRows: rows, maxRows: rows }"
    >
    </a-textarea>
  </a-form-model-item>
</template>

<script>
export default {
  name: 'ResealTextarea',
  props: {
    // 绑定的对象
    form: {
      type: Object,
      default: () => {
        return {};
      }
    },
    // label格数
    labelCol: {
      type: Object,
      default: () => {
        return null;
      }
    },
    // input格数
    wrapperCol: {
      type: Object,
      default: () => {
        return null;
      }
    },
    // 绑定对象的属性
    prop: {
      type: String,
      default: 'attribute'
    },
    // 显示行数
    rows: {
      type: Number,
      default: 4
    },
    // 文字
    label: {
      type: String,
      default: ''
    },
    placeholder: {
      type: String,
      default: '请输入'
    },
    // 禁止操作
    disabled: {
      type: Boolean,
      default: false
    },
    // 只读
    readonly: {
      type: Boolean,
      default: false
    },
    // 输入框前部内容
    prefix: {
      type: String,
      default: ''
    },
    // 输入框后部内容
    suffix: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      inputValue: null
    };
  },
  methods: {
    // checkIt() {
    //   this.$emit('showDialog');
    // }
  }
};
</script>
